package com.ctsi.auth.integration;

import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author zhangjw
 * @className IntegrationAuthentication
 * @description 集成校验
 * @date 2019/2/21 14:09
 **/
public class IntegrationAuthentication {

    private String authType;
    private String username;
    /**
     * 登陆次数，限制为5次，5次之后锁定账户
     */
    private AtomicInteger loginCount = new AtomicInteger(5);
    private Map<String,String[]> authParameters;

    public String getAuthParameter(String paramter){
        String[] values = this.authParameters.get(paramter);
        if(values != null && values.length > 0){
            return values[0];
        }
        return null;
    }

    public String getAuthType() {
        return authType;
    }

    public void setAuthType(String authType) {
        this.authType = authType;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Map<String, String[]> getAuthParameters() {
        return authParameters;
    }

    public void setAuthParameters(Map<String, String[]> authParameters) {
        this.authParameters = authParameters;
    }

    public AtomicInteger getLoginCount() {
        return loginCount;
    }

    public void setLoginCount(AtomicInteger loginCount) {
        this.loginCount = loginCount;
    }
}
